//package org.rcy.ruicingmarket.goods.job;
//
//
//import org.rcy.ruicingmarket.goods.constant.RedisConstant;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.data.redis.core.RedisTemplate;
//import org.springframework.scheduling.annotation.EnableScheduling;
//import org.springframework.stereotype.Component;
//
//import java.util.Set;
//
///**
// * @author RuicyWu
// * @Date 2022/3/17 11:43
// * 清除垃圾图片job
// */
//
//@Configuration
//@Component
//@EnableScheduling
//public class ClearGarbagePictureJob {
//
//    protected final Logger logger = LoggerFactory.getLogger(getClass());
//
//    @Autowired
//    private RedisTemplate redisTemplate;
//
//
//    public void clearPic() {
//        try {
//            Set<String> picDifference = redisTemplate.opsForSet().difference(RedisConstant.GOODS_PIC_RESOURCES, RedisConstant.GOODS_PIC_DB_RESOURCES);
//            String[] files = new String[picDifference.size()];
//            int i = 0;
//            for (String file : picDifference) {
////                ftpUtil.deleteFile(file);
//                files[i++] = file;
//            }
//            redisTemplate.opsForSet().remove(RedisConstant.GOODS_PIC_RESOURCES, files);
//        } catch (Exception e) {
//            logger.error(e.getMessage(), e);
//        }
//
//    }
//}
